package livesun.justiceeternal.db;


import livesun.justiceeternal.db.task.BaseMsgNotificator;

public abstract class IModule<T> extends BaseMsgNotificator<T> {
    private ModuleStatus mStatus = ModuleStatus.prepared;

    public void startLoader() {
        mStatus = ModuleStatus.loading;
        onLoaderStart();
    }

    protected abstract void onLoaderStart();

    protected final void setLoaderFinished() {
        mStatus = ModuleStatus.finished;
    }

    protected final ModuleStatus getStatus() {
        return mStatus;
    }

    enum ModuleStatus {
        prepared, loading, finished
    }
}
